package top.wangjiu.reactive.rpc.model;

import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
public class RpcResponse<T> {

    private String requestId;
    private boolean last;
    private boolean first;
    private boolean success = true;
    private T result;
    private Throwable cause;

    public RpcResponse(String requestId){
        this.requestId = requestId;
    }

    public RpcResponse(String requestId,T result){
        this.requestId = requestId;
        this.result = result;
    }

    public RpcResponse(String requestId,boolean success){
        this.requestId = requestId;
        this.success = success;
    }

}
